/**
* @Title: SimpleChatClientInitializer.java
* @Package com.an.simplechat
* @Description: TODO(用一句话描述该文件做什么)
* @author antch,861710865@qq.com
* @date 2017年7月21日 上午10:14:36
* @version V1.0
*/


package com.an.simplechat;


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.Delimiters;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

/**
* @ClassName: SimpleChatClientInitializer
* @Description: TODO(这里用一句话描述这个类的作用)
* @author antch,861710865@qq.com
* @date 2017年7月21日 上午10:14:36
*
*/

public class SimpleChatClientInitializer extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		// TODO Auto-generated method stub
		ChannelPipeline pipeline = ch.pipeline();

		pipeline.addLast("framer",new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
		pipeline.addLast("decoder",new StringDecoder());
		pipeline.addLast("encoder",new StringEncoder());
		pipeline.addLast("handler",new SimpleChatClientHandler());
//		pipeline.addLast("outbound",new ClientOutBpundehandler());


	}

}
